package siga.visao;

import siga.visao_busca.buscaVer;
import siga.visao_busca.buscaCentroCusto;
import siga.visao_busca.buscaCurso;
import siga.visao_busca.buscaTurma;
import siga.visao_busca.buscaPlanoContas;
import java.awt.Color;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.StringTokenizer;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeCellRenderer;
import siga.banco.conexao;
import siga.navegadores.navegador;

public class relGerenciador_financeiro extends javax.swing.JInternalFrame {
    List LRdescricao = new ArrayList();
    List LRarquivo = new ArrayList();
    List LRurl = new ArrayList();
    List LRcaixa = new ArrayList();
    
    Icon leafIcon = new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/relatorio_16x16.png"));
    Icon openIcon = new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/printer_16.png"));
    Icon closedIcon = new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/printer_16.png"));

    public relGerenciador_financeiro() {
        initComponents();
        carregaCaixa();
        jtfAno.setText(new SimpleDateFormat("yyyy").format(new Date()));
    }

    private void carregaCaixa(){
        jtfCaixa.removeAllItems();
        try {
            conexao.Query("select fc.codigo,fc.descricao from fin_caixa fc" +
                    " where fc.cod_emp="+index.cod_emp+" order by descricao");
            LRcaixa.add(0);
            jtfCaixa.addItem("Todos os Caixas");
            while(conexao.rs.next()){
                LRcaixa.add(conexao.rs.getString("codigo"));
                jtfCaixa.addItem(conexao.rs.getString("descricao"));
            }
        } catch (SQLException ex) {
            verErros.setErro(ex.getMessage());
        }
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSplitPane1 = new javax.swing.JSplitPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTree1 = new javax.swing.JTree();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jtfParcIni = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jtfParcFin = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jtfAno = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jtfCurso = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jtfTurma = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jtfFase = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jtfPessoa = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jbLimpar2 = new javax.swing.JButton();
        jbLimpar3 = new javax.swing.JButton();
        jbLimpar4 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jtfPlanoContas = new javax.swing.JTextField();
        jtfCentroCusto = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jtfCaixa = new javax.swing.JComboBox();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jbLimpar = new javax.swing.JButton();
        jbLimpar1 = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jtfDtIni = new javax.swing.JFormattedTextField();
        jtfDtFin = new javax.swing.JFormattedTextField();
        jButton8 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jButton14 = new javax.swing.JButton();
        jButton15 = new javax.swing.JButton();
        jButton16 = new javax.swing.JButton();
        jButton17 = new javax.swing.JButton();
        jButton18 = new javax.swing.JButton();
        jButton19 = new javax.swing.JButton();
        jButton20 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        setTitle("Gerenciador de Relatórios");
        setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/relatorio_16x16.png"))); // NOI18N
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameOpened(evt);
            }
        });

        jSplitPane1.setDividerLocation(300);
        jSplitPane1.setName("jSplitPane1"); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jTree1.setFont(new java.awt.Font("SansSerif", 0, 11)); // NOI18N
        javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("Relatórios");
        javax.swing.tree.DefaultMutableTreeNode treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Diários");
        javax.swing.tree.DefaultMutableTreeNode treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Diário de Notas");
        treeNode2.add(treeNode3);
        treeNode1.add(treeNode2);
        treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Históricos");
        treeNode1.add(treeNode2);
        treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Listas");
        treeNode1.add(treeNode2);
        treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Outros");
        treeNode1.add(treeNode2);
        jTree1.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
        jTree1.setName("jTree1"); // NOI18N
        jTree1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTree1MouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jTree1);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 696, Short.MAX_VALUE)
        );

        jSplitPane1.setLeftComponent(jPanel1);

        jPanel2.setName("jPanel2"); // NOI18N

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Boleto Financeiro", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 0, 11))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jLabel7.setText("Parcela Inicial:");
        jLabel7.setName("jLabel7"); // NOI18N

        jtfParcIni.setName("jtfParcIni"); // NOI18N

        jLabel8.setText("Parcela Final:");
        jLabel8.setName("jLabel8"); // NOI18N

        jtfParcFin.setName("jtfParcFin"); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfParcIni))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(18, 18, 18)
                        .addComponent(jtfParcFin, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(473, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jtfParcIni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jtfParcFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Dados Gerais", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 0, 11))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jLabel1.setText("Ano:");
        jLabel1.setName("jLabel1"); // NOI18N

        jtfAno.setName("jtfAno"); // NOI18N

        jLabel2.setText("Curso:");
        jLabel2.setName("jLabel2"); // NOI18N

        jtfCurso.setEditable(false);
        jtfCurso.setName("jtfCurso"); // NOI18N

        jLabel3.setText("Turma:");
        jLabel3.setName("jLabel3"); // NOI18N

        jtfTurma.setEditable(false);
        jtfTurma.setName("jtfTurma"); // NOI18N

        jLabel4.setText("Bimestre / Fase / Módulo:");
        jLabel4.setName("jLabel4"); // NOI18N

        jtfFase.setEditable(false);
        jtfFase.setName("jtfFase"); // NOI18N

        jLabel6.setText("Pessoa:");
        jLabel6.setName("jLabel6"); // NOI18N

        jtfPessoa.setEditable(false);
        jtfPessoa.setName("jtfPessoa"); // NOI18N

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/busca_16x16.png"))); // NOI18N
        jButton2.setName("jButton2"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/busca_16x16.png"))); // NOI18N
        jButton3.setName("jButton3"); // NOI18N
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/busca_16x16.png"))); // NOI18N
        jButton4.setName("jButton4"); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jbLimpar2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sair_16x16.png"))); // NOI18N
        jbLimpar2.setToolTipText("Limpar Campo");
        jbLimpar2.setName("jbLimpar2"); // NOI18N
        jbLimpar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbLimpar2ActionPerformed(evt);
            }
        });

        jbLimpar3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sair_16x16.png"))); // NOI18N
        jbLimpar3.setToolTipText("Limpar Campo");
        jbLimpar3.setName("jbLimpar3"); // NOI18N
        jbLimpar3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbLimpar3ActionPerformed(evt);
            }
        });

        jbLimpar4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sair_16x16.png"))); // NOI18N
        jbLimpar4.setToolTipText("Limpar Campo");
        jbLimpar4.setName("jbLimpar4"); // NOI18N
        jbLimpar4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbLimpar4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfAno, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfFase, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(6, 6, 6)
                        .addComponent(jtfCurso, javax.swing.GroupLayout.DEFAULT_SIZE, 571, Short.MAX_VALUE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfTurma, javax.swing.GroupLayout.DEFAULT_SIZE, 561, Short.MAX_VALUE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtfPessoa, javax.swing.GroupLayout.DEFAULT_SIZE, 557, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbLimpar4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbLimpar3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbLimpar2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(14, 14, 14))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap(56, Short.MAX_VALUE)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jbLimpar4)
                            .addComponent(jButton4)))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addGap(16, 16, 16)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jtfAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jtfCurso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(jtfTurma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jbLimpar3)
                            .addComponent(jButton3))))
                .addGap(11, 11, 11)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jtfFase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(jtfPessoa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jButton2)
                    .addComponent(jbLimpar2))
                .addContainerGap())
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Dados Financeiros", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 0, 11))); // NOI18N
        jPanel5.setName("jPanel5"); // NOI18N

        jLabel9.setText("Plano de Contas:");
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel10.setText("Centro de Custo:");
        jLabel10.setName("jLabel10"); // NOI18N

        jtfPlanoContas.setEditable(false);
        jtfPlanoContas.setName("jtfPlanoContas"); // NOI18N

        jtfCentroCusto.setEditable(false);
        jtfCentroCusto.setName("jtfCentroCusto"); // NOI18N

        jLabel11.setText("Caixa:");
        jLabel11.setName("jLabel11"); // NOI18N

        jtfCaixa.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        jtfCaixa.setName("jtfCaixa"); // NOI18N

        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/busca_16x16.png"))); // NOI18N
        jButton5.setName("jButton5"); // NOI18N
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/busca_16x16.png"))); // NOI18N
        jButton6.setName("jButton6"); // NOI18N
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jbLimpar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sair_16x16.png"))); // NOI18N
        jbLimpar.setToolTipText("Limpar Campo");
        jbLimpar.setName("jbLimpar"); // NOI18N
        jbLimpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbLimparActionPerformed(evt);
            }
        });

        jbLimpar1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/sair_16x16.png"))); // NOI18N
        jbLimpar1.setToolTipText("Limpar Campo");
        jbLimpar1.setName("jbLimpar1"); // NOI18N
        jbLimpar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbLimpar1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jtfCaixa, javax.swing.GroupLayout.PREFERRED_SIZE, 305, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel9)
                            .addComponent(jLabel10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jtfCentroCusto, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)
                            .addComponent(jtfPlanoContas, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbLimpar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbLimpar, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(jtfPlanoContas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel10)
                            .addComponent(jtfCentroCusto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(jtfCaixa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton6)
                            .addComponent(jbLimpar))
                        .addGap(12, 12, 12)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jbLimpar1)
                            .addComponent(jButton5))))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Intervalo de Datas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("SansSerif", 0, 11))); // NOI18N
        jPanel6.setName("jPanel6"); // NOI18N

        jLabel12.setText("Data Inicial:");
        jLabel12.setName("jLabel12"); // NOI18N

        jLabel13.setText("Data Final:");
        jLabel13.setName("jLabel13"); // NOI18N

        try {
            jtfDtIni.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtIni.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtIni.setName("jtfDtIni"); // NOI18N

        try {
            jtfDtFin.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        jtfDtFin.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jtfDtFin.setName("jtfDtFin"); // NOI18N

        jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton8.setText("Hoje");
        jButton8.setToolTipText("Data de Hoje");
        jButton8.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton8.setName("jButton8"); // NOI18N
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        jButton9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton9.setText("Jan");
        jButton9.setToolTipText("");
        jButton9.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton9.setName("jButton9"); // NOI18N
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jButton10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton10.setText("Fev");
        jButton10.setToolTipText("");
        jButton10.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton10.setName("jButton10"); // NOI18N
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        jButton11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton11.setText("Mar");
        jButton11.setToolTipText("");
        jButton11.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton11.setName("jButton11"); // NOI18N
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        jButton12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton12.setText("Maio");
        jButton12.setToolTipText("");
        jButton12.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton12.setName("jButton12"); // NOI18N
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        jButton13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton13.setText("Abr");
        jButton13.setToolTipText("");
        jButton13.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton13.setName("jButton13"); // NOI18N
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        jButton14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton14.setText("Jun");
        jButton14.setToolTipText("");
        jButton14.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton14.setName("jButton14"); // NOI18N
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton14ActionPerformed(evt);
            }
        });

        jButton15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton15.setText("Julh");
        jButton15.setToolTipText("");
        jButton15.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton15.setName("jButton15"); // NOI18N
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton15ActionPerformed(evt);
            }
        });

        jButton16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton16.setText("Ago");
        jButton16.setToolTipText("");
        jButton16.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton16.setName("jButton16"); // NOI18N
        jButton16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton16ActionPerformed(evt);
            }
        });

        jButton17.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton17.setText("Set");
        jButton17.setToolTipText("");
        jButton17.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton17.setName("jButton17"); // NOI18N
        jButton17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton17ActionPerformed(evt);
            }
        });

        jButton18.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton18.setText("Nov");
        jButton18.setToolTipText("");
        jButton18.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton18.setName("jButton18"); // NOI18N
        jButton18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton18ActionPerformed(evt);
            }
        });

        jButton19.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton19.setText("Out");
        jButton19.setToolTipText("");
        jButton19.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton19.setName("jButton19"); // NOI18N
        jButton19.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton19ActionPerformed(evt);
            }
        });

        jButton20.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/JDateChooserColor16.gif"))); // NOI18N
        jButton20.setText("Dez");
        jButton20.setToolTipText("");
        jButton20.setMargin(new java.awt.Insets(1, 1, 1, 1));
        jButton20.setName("jButton20"); // NOI18N
        jButton20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton20ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jLabel12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jtfDtIni, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtfDtFin))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton10)
                    .addComponent(jButton11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton14)
                    .addComponent(jButton15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton19))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton20)
                .addContainerGap(36, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(7, 7, 7)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(jtfDtIni, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jtfDtFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13)))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton8)
                            .addComponent(jButton10))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton9)
                            .addComponent(jButton11)))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jButton13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton12))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jButton14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton15))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jButton16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton17))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButton19)
                            .addComponent(jButton20))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton18)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/siga/imagem/printer_32.png"))); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton1)
                .addContainerGap(16, Short.MAX_VALUE))
        );

        jSplitPane1.setRightComponent(jPanel2);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1052, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 696, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
       if(jTree1.getLastSelectedPathComponent() != null){
           for(int i=0;i<LRdescricao.size();i++){
               if(LRdescricao.get(i).equals(jTree1.getLastSelectedPathComponent().toString())){
                   navegador.URL(LRarquivo.get(i).toString()+"?cod_emp="+index.cod_emp+"&cod_user="+index.usuario[0]+
                           "&ano="+jtfAno.getText()+"&cod_curso="+index.LRcurso.get(0)+"&cod_matricula="+index.LRturma.get(0)+
                           "&cod_fase="+jtfFase.getText()+"&cod_pessoa="+index.LRpessoa.get(0)+"&desc_pessoa="+index.LRpessoa.get(1)+
                           "&parc_ini="+jtfParcIni.getText()+"&parc_fim="+jtfParcFin.getText()+"&datai="+jtfDtIni.getText()+
                           "&dataf="+jtfDtFin.getText()+"&cod_plano_contas="+index.LRcontas.get(0)+"&desc_plano_contas="+index.LRcontas.get(1)+
                           "&cod_centro_custo="+index.LRcentro.get(0)+"&desc_centro_custo="+index.LRcentro.get(1)+"&cod_caixa="+LRcaixa.get(jtfCaixa.getSelectedIndex()));
               }
           }
       }else{
           JOptionPane.showMessageDialog(null, "Favor selecionar um relatório.","Informação do Sistema",JOptionPane.ERROR_MESSAGE);
       }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        buscaVer.setTipo("");
        OpenBuscaVer();
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        jtfDtIni.setText(new SimpleDateFormat("dd/MM/yyyy").format(new Date()));
        jtfDtFin.setText(new SimpleDateFormat("dd/MM/yyyy").format(new Date()));
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        jtfDtIni.setText("01/01/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/01/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        jtfDtIni.setText("01/02/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/02/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton10ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        jtfDtIni.setText("01/03/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/03/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton11ActionPerformed

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
        jtfDtIni.setText("01/05/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/05/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton12ActionPerformed

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        jtfDtIni.setText("01/04/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/04/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton13ActionPerformed

    private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
        jtfDtIni.setText("01/06/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/06/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton14ActionPerformed

    private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
        jtfDtIni.setText("01/07/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/07/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton15ActionPerformed

    private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton16ActionPerformed
        jtfDtIni.setText("01/08/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/08/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton16ActionPerformed

    private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed
        jtfDtIni.setText("01/09/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/09/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton17ActionPerformed

    private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
        jtfDtIni.setText("01/11/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/11/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton18ActionPerformed

    private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton19ActionPerformed
        jtfDtIni.setText("01/10/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/10/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton19ActionPerformed

    private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton20ActionPerformed
        jtfDtIni.setText("01/12/"+new SimpleDateFormat("yyyy").format(new Date()));
        jtfDtFin.setText("31/12/"+new SimpleDateFormat("yyyy").format(new Date()));
    }//GEN-LAST:event_jButton20ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        index.LRcurso.add(0, "");
        index.LRcurso.add(1, "");
        buscaCurso bc = new buscaCurso(null,true);
        bc.setLocation((index.tela.width-bc.getWidth())/2, (index.tela.height-bc.getHeight())/2);
        bc.setVisible(true);
        if(buscaCurso.isConfirmaCurso()){
            jtfCurso.setText(index.LRcurso.get(1).toString());
        }
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        index.LRturma.add(0, "");
        index.LRturma.add(1, "");
        buscaTurma bt = new buscaTurma(null,true);
        bt.setLocation((index.tela.width-bt.getWidth())/2, (index.tela.height-bt.getHeight())/2);
        bt.setVisible(true);
        if(buscaTurma.isConfirmaTurma()){
            jtfTurma.setText(index.LRturma.get(0).toString());
            jtfFase.setText(index.LRfase.get(0).toString());
        }
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        index.LRcontas.add(0, "");
        index.LRcontas.add(1, "");
        buscaPlanoContas bpc = new buscaPlanoContas(null,true);
        bpc.setLocation((index.tela.width-bpc.getWidth())/2, (index.tela.height-bpc.getHeight())/2);
        bpc.setVisible(true);
        if(buscaPlanoContas.isConfirmaContas()){
           jtfPlanoContas.setText(index.LRcontas.get(1).toString());
        }
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        index.LRcentro.add(0, "");
        index.LRcentro.add(1, "");
        buscaCentroCusto bcc = new buscaCentroCusto(null,true);
        bcc.setLocation((index.tela.width-bcc.getWidth())/2, (index.tela.height-bcc.getHeight())/2);
        bcc.setVisible(true);
        if(buscaCentroCusto.isConfirmaCentro()){
           jtfCentroCusto.setText(index.LRcentro.get(1).toString());
        }
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jTree1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTree1MouseClicked
       if(jTree1.getLastSelectedPathComponent() != null){
           for(int i=0;i<LRdescricao.size();i++){
               if(LRdescricao.get(i).equals(jTree1.getLastSelectedPathComponent().toString())){
                   StringTokenizer Tok = new StringTokenizer(LRurl.get(i).toString(), "'");
                   LimpaCorObj();
                   while (Tok.hasMoreElements()){
                       MudaCorObj(Tok.nextElement().toString());
                   }
                }
            }
        }
    }//GEN-LAST:event_jTree1MouseClicked

    private void jbLimparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbLimparActionPerformed
        index.LRcontas.add(0,"");
        index.LRcontas.add(1,"");
        jtfPlanoContas.setText("");
    }//GEN-LAST:event_jbLimparActionPerformed

    private void jbLimpar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbLimpar1ActionPerformed
        index.LRcentro.add(0,"");
        index.LRcentro.add(1,"");
        jtfCentroCusto.setText("");
    }//GEN-LAST:event_jbLimpar1ActionPerformed

    private void jbLimpar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbLimpar2ActionPerformed
        index.LRpessoa.add(0,"");
        index.LRpessoa.add(1,"");
        jtfPessoa.setText("");
    }//GEN-LAST:event_jbLimpar2ActionPerformed

    private void jbLimpar3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbLimpar3ActionPerformed
        index.LRturma.add(0,"");
        index.LRturma.add(1,"");
        jtfTurma.setText("");
        jtfFase.setText("");
    }//GEN-LAST:event_jbLimpar3ActionPerformed

    private void jbLimpar4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbLimpar4ActionPerformed
        index.LRcurso.add(0,"");
        index.LRcurso.add(1,"");
        jtfCurso.setText("");
    }//GEN-LAST:event_jbLimpar4ActionPerformed

    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened
        DefaultMutableTreeNode raiz, no1, no2, no3, no4, no5, no6, no7;
        raiz = new DefaultMutableTreeNode("Relatorios");
        no1 = new DefaultMutableTreeNode("Receitas");
        no2 = new DefaultMutableTreeNode("Despesas");
        no3 = new DefaultMutableTreeNode("Cartas");
        no4 = new DefaultMutableTreeNode("Extratos");
        no5 = new DefaultMutableTreeNode("Listas");
        no6 = new DefaultMutableTreeNode("Outros");
        no7 = new DefaultMutableTreeNode("Negociação");

        raiz.add(no1);
        raiz.add(no2);
        raiz.add(no3);
        raiz.add(no4);
        raiz.add(no5);
        raiz.add(no6);
        raiz.add(no7);

        try {
            conexao.Query("select * from relatorios where tipo=\"Financeiro\" and cod_emp="+index.cod_emp+" and status=\"Ativo\" and filtro_tree is not null order by filtro_tree,descricao");
            LRdescricao.clear();
            LRurl.clear();
            LRarquivo.clear();
            while(conexao.rs.next()){
                LRdescricao.add(conexao.rs.getString("descricao"));
                LRurl.add(conexao.rs.getString("url"));
                LRarquivo.add(index.relatorio+conexao.rs.getString("arquivo"));
                switch(conexao.rs.getInt("filtro_tree")){
                    case 1:
                        no1.add(new DefaultMutableTreeNode(conexao.rs.getString("descricao")));
                        break;
                    case 2:
                        no2.add(new DefaultMutableTreeNode(conexao.rs.getString("descricao")));
                        break;
                    case 3:
                        no3.add(new DefaultMutableTreeNode(conexao.rs.getString("descricao")));
                        break;
                    case 4:
                        no4.add(new DefaultMutableTreeNode(conexao.rs.getString("descricao")));
                        break;
                    case 5:
                        no5.add(new DefaultMutableTreeNode(conexao.rs.getString("descricao")));
                        break;
                    case 6:
                        no6.add(new DefaultMutableTreeNode(conexao.rs.getString("descricao")));
                        break;
                    case 7:
                        no7.add(new DefaultMutableTreeNode(conexao.rs.getString("descricao")));
                        break;
                }
            }
        } catch (SQLException ex) {
            verErros.setErro(ex.getStackTrace().toString());
        }

        //Inseri imagens ao jtree
        DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer)jTree1.getCellRenderer();
        renderer.setLeafIcon(leafIcon);
        renderer.setClosedIcon(closedIcon);
        renderer.setOpenIcon(openIcon);

        jTree1.setModel(new javax.swing.tree.DefaultTreeModel(raiz));
    }//GEN-LAST:event_formInternalFrameOpened
    private void LimpaCorObj(){
        jLabel11.setForeground(new Color(0,0,0));
        jLabel12.setForeground(new Color(0,0,0));
        jLabel13.setForeground(new Color(0,0,0));
        jLabel6.setForeground(new Color(0,0,0));
        jLabel7.setForeground(new Color(0,0,0));
        jLabel8.setForeground(new Color(0,0,0));
        jLabel4.setForeground(new Color(0,0,0));
        jLabel3.setForeground(new Color(0,0,0));
        jLabel10.setForeground(new Color(0,0,0));
        jLabel9.setForeground(new Color(0,0,0));
    }
    private void MudaCorObj(String Campo){
        if(Campo.equals("tr_caixa")){
            jLabel11.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_dt_ini")){
            jLabel12.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_dt_fim")){
            jLabel13.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_pessoa")){
            jLabel6.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_parc_ini")){
            jLabel7.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_parc_fim")){
            jLabel8.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_fase")){
            jLabel4.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_turma")){
            jLabel3.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_centro")){
            jLabel10.setForeground(new Color(255,51,51));
        }
        if(Campo.equals("tr_plano")){
            jLabel9.setForeground(new Color(255,51,51));
        }
    }

    protected void OpenBuscaVer(){
        index.LRpessoa.add(0, "");
        index.LRpessoa.add(1, "");
        buscaVer bv = new buscaVer(null,true);
        bv.setLocation((index.tela.width-bv.getWidth())/2, (index.tela.height-bv.getHeight())/2);
        bv.setVisible(true);
        if(buscaVer.isConfirmaBusca()){
            jtfPessoa.setText(index.LRpessoa.get(1).toString());
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton15;
    private javax.swing.JButton jButton16;
    private javax.swing.JButton jButton17;
    private javax.swing.JButton jButton18;
    private javax.swing.JButton jButton19;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton20;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTree jTree1;
    private javax.swing.JButton jbLimpar;
    private javax.swing.JButton jbLimpar1;
    private javax.swing.JButton jbLimpar2;
    private javax.swing.JButton jbLimpar3;
    private javax.swing.JButton jbLimpar4;
    private javax.swing.JTextField jtfAno;
    private javax.swing.JComboBox jtfCaixa;
    private javax.swing.JTextField jtfCentroCusto;
    private javax.swing.JTextField jtfCurso;
    private javax.swing.JFormattedTextField jtfDtFin;
    private javax.swing.JFormattedTextField jtfDtIni;
    private javax.swing.JTextField jtfFase;
    private javax.swing.JTextField jtfParcFin;
    private javax.swing.JTextField jtfParcIni;
    private javax.swing.JTextField jtfPessoa;
    private javax.swing.JTextField jtfPlanoContas;
    private javax.swing.JTextField jtfTurma;
    // End of variables declaration//GEN-END:variables

}
